<?php
header("Content-type:text/xml");

error_reporting(E_ALL);
ini_set("display_errors",1);

include_once "config/classes/class.DataBase.php";

$bd = new DataBase();

$center_lat = $_POST['center_lat'];
$center_lng = $_POST['center_lng'];

/*
 * 
 * IMPLEMENTACION
 * 
 */
$distancia = 10;
$result = $bd->generarXmlMarkers($center_lat,$center_lng,$distancia);



$salida = '<?xml version="1.0"?>';
//$salida .= "<debug_info>";
//$salida .=      "<centro_lat> $center_lat </centro_lat>";
//$salida .=      "<centro_lng> $center_lng </centro_lng>";
//$salida .=      "<distancia> $distancia </distancia>";            
//$salida .= "</debug_info>";
$salida .= "<markers>";

while ($r = mysql_fetch_array($result))
{    
    $salida.= " <marker id='".$r['id']."' lat='".$r['lat']."' lng='".$r['lng']."' desc='".$r['comentario']."' />";            
}

$salida .= "</markers>";
echo $salida;

?>
